<?php

global $project;
$project = 'mysite';

global $databaseConfig;
$databaseConfig = array(
	"type" => 'MySQLDatabase',
	"server" => 'localhost', 
	"username" => 'root', 
	"password" => '', 
	"database" => 'bankcard',
	"path" => '',
);

MySQLDatabase::set_connection_charset('utf8');
Director::set_environment_type("dev");
// This line set's the current theme. More themes can be
// downloaded from http://www.silverstripe.org/themes/
SSViewer::set_theme('cards');

// Set the site locale
i18n::set_locale('en_US');

// enable nested URLs for this site (e.g. page/sub-page/)
SiteTree::enable_nested_urls();
// Đa ngôn ngữ
global $allowed_locales; 
$allowed_locales = array( 
	'en_US' => array('English', 'English'), 
); 
i18n::$common_locales = $allowed_locales;
Translatable::enable(); 
Object::add_extension('SiteTree', 'Translatable');
Object::add_extension('SiteConfig', 'Translatable');

Requirements::set_write_js_to_body(false);
LeftAndMain::setLogo(null,null);
LeftAndMain::setApplicationName("Best Credit Card","Best Credit Card","http://bestcreditcard.com.vn/");

/******* Config menu Admin*****************/
// add a button to remove formatting
HtmlEditorConfig::get('cms')->insertButtonsBefore(
    'styleselect',
    'removeformat'
);
 
// tel the button which tags it may remove
HtmlEditorConfig::get('cms')->setOption(
    'removeformat_selector',
    'b,strong,em,i,span,ins'
);
//CMSMenu::remove_menu_item('CMSMain');
//CMSMenu::remove_menu_item('AssetAdmin');
CMSMenu::remove_menu_item('ReportAdmin');
CMSMenu::remove_menu_item('CommentAdmin');
//CMSMenu::remove_menu_item('SecurityAdmin');

SWFUploadConfig::addFileTypes(array('mp3','jpg','png','gif','tif','eps'));
SWFUploadConfig::set_var('file_upload_limit',50);
SWFUploadConfig::set_var('file_queue_limit',50);
SWFUploadConfig::set_var('file_size_limit','10MB');

/* { PHPMAILER */ 
$path = Director::baseFolder().'/phpmailer/'; 
set_include_path(get_include_path() . PATH_SEPARATOR . $path); 
require_once 'class.phpmailer.php'; 

global $to;
$to="khanh.le@fssvn.com";
global $phpmailer; 
$phpmailer = new PHPMailer(); 
$phpmailer->CharSet = "UTF-8"; 
$phpmailer->IsSMTP(); // send via SMTP 
$phpmailer->SMTPSecure = "tls";  //ssl 
$phpmailer->Host = "smtp.gmail.com"; // SMTP servers 
$phpmailer->Port = 587;//465         
$phpmailer->SMTPAuth = true; // turn on SMTP authentication 
$phpmailer->Username = "silverstripe.fss"; // SMTP username 
$phpmailer->Password = "fss@123456"; // SMTP password 
$phpmailer->FromName = "EcoGaoLuc";// sets the prefix to the servier
/*
$phpmailer->AddCustomHeader('Reply-to:khanh.le@fssvn.com"');
$phpmailer->AddCC('khanh.le@fssvn.com', 'TransOcean Service');
$phpmailer->From = "silverstripe.fss@gmail.com";
*/
$phpmailer->SMTPDebug  = false;   
$phpmailer->IsHTML(true);